import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [{
        path: '/',
        redirect: '/home_page1',
        name: 'Home',
        component: () =>
            import ('../views/home.vue'),
        children: [{
                path: '/home_page1',
                meta: {
                    title: '系统首页',
                },
                name: 'home_page1',
                component: () =>
                    import ('../views/home_page1.vue')
            },
            {
                path: '/home_page1',
                meta: {
                    title: '系统首页',
                },
                name: 'home_page1',
                component: () =>
                    import ('../views/home_page1.vue')
            },
            {
                path: '/home_page2',
                meta: {
                    title: '基础表格',
                },
                name: 'home_page2',
                component: () =>
                    import ('../views/home_page2.vue')
            },
            {
                path: '/home_page3',
                meta: {
                    title: 'Table选项卡',
                },
                name: 'home_page3',
                component: () =>
                    import ('../views/home_page3.vue')
            },
            {
                path: '/home_form',
                meta: {
                    title: '基本表单',
                },
                name: 'home_form',
                component: () =>
                    import ('../views/home_form.vue')
            },
            {
                path: '/uploader',
                meta: {
                    title: '文件上传',
                },
                name: 'uploader',
                component: () =>
                    import ('../views/uploader.vue')
            },
            {
                path: '/home_step',
                meta: {
                    title: '自定义',
                },
                name: 'home_step',
                component: () =>
                    import ('../views/home_step.vue')
            },
            {
                path: '/echars',
                meta: {
                    title: 'echars图表',
                },
                name: 'echars',
                component: () =>
                    import ('../views/echars.vue')
            },
            {
                path: '/quill',
                meta: {
                    title: '富文本编辑器',
                },
                name: 'quill',
                component: () =>
                    import ('../views/quill.vue')
            },
            {
                path: '/mavonEditor',
                meta: {
                    title: 'markdown编辑器',
                },
                name: 'mavonEditor',
                component: () =>
                    import ('../views/mavonEditor.vue')
            },
            {
                path: '/darg_list',
                meta: {
                    title: '拽拉列表',
                },
                name: 'darg_list',
                component: () =>
                    import ('../views/darg_list.vue')
            },
            {
                path: '/dialog',
                meta: {
                    title: '拽拉弹框',
                },
                name: 'dialog',
                component: () =>
                    import ('../views/dialog.vue')
            },
            {
                path: '/langs',
                meta: {
                    title: '国际化功能',
                },
                name: 'langs',
                component: () =>
                    import ('../views/langs.vue')
            },
            {
                path: '/error',
                meta: {
                    title: '错误处理',
                },
                name: 'error',
                component: () =>
                    import ('../views/error.vue')
            },
            {
                path: '/autorun',
                meta: {
                    title: '错误处理',
                },
                name: 'autorun',
                component: () =>
                    import ('../views/autorun.vue')
            }
        ]
    },
    {
        path: '/login',
        name: 'login',
        component: () =>
            import ('../components/login/index.vue')
    }
]

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router